1. Field of the Invention
The present invention relates to an image processing apparatus capable of performing graphic processing such as hidden plane processing on a video signal obtained from a video camera or the like.
2. Description of the Related Art
Computer graphics are often used in a variety of computer aided design (CAD) systems and amusement machines. Especially, along with the recent advances in image processing techniques, systems using three-dimensional computer graphics are becoming rapidly widespread.
In three-dimensional computer graphics, the color value of each pixel is calculated at the time of deciding the color of each corresponding pixel. Then, rendering is performed for writing the calculated value to an address of a display buffer (frame buffer) corresponding to the pixel.
One of the rendering methods is polygon rendering. In this method, a three-dimensional model is expressed as an composite of triangular unit graphics (polygons). By drawing the polygons as units, the colors of the pixels of the display screen are decided.
Also, in the three-dimensional computer graphics, hidden plane processing using a z-buffer memory is performed.
Namely, when composing a first image data (color data) already stored in a display buffer memory and a second image data subjected to graphic processing, it is judged whether or not an image corresponding to the second image data is positioned closer to the viewing point than an image corresponding to the first image data by comparing first z-data stored in the z-buffer memory and second z-data corresponding to the second image data. Then, when it is judged that it is positioned closer, the first z-data stored in the z-buffer memory is updated by the second z-data, and the first image data stored in a display buffer memory is updated by the second image data.
Then, the image data is read from the display buffer memory and output to a display such as a CRT (cathode ray tube).
There has been a demand to performing processing by using a three-dimensional computer graphic system on a video signal obtained by taking a picture of a natural image by an image pickup apparatus such as a video camera.
However, since a video signal does not include z-data, there is a disadvantage of an incapability of handling the input video signal in the same way as an image signal obtained through normal graphic processing when simply inputting the video signal taken by an image pickup apparatus into a three-dimensional computer graphic system. For example, a video signal has a disadvantage that hidden plane processing etc. cannot be performed.
The present invention was made in consideration of the above prior art and has as its object providing an image processing apparatus and method capable of performing a variety of graphic processing using a video signal taken by an image pickup apparatus.
To solve the above problems of the prior art and to achieve the above object, the image processing apparatus of the present invention provides a first memory for storing image data for output to a display; a second memory for storing depth data of said image data; an image processing circuit for performing three-dimensional graphic processing of predetermined data to generate a three-dimensional image data including first image data and first depth data corresponding to the first image data; and a write circuit for writing said first image data and said first depth data respectively in said first memory and said second memory as said image data and said depth data and, when second image data corresponding to image pickup data and second depth data corresponding to said second image data are input, writing said second image data and said second depth data respectively to said first memory and said second memory as said image data and said depth data.
In the image processing apparatus of the present invention, when second image data corresponding to image pickup data of, for example, an image pickup apparatus and second depth data corresponding to said second image data are input by a write circuit, said second image data and said second depth data are respectively written to said first memory and said second memory.
Therefore, it becomes possible to handle the second image data stored in the first memory in the same way as the first image data. subjected to normal three-dimensional graphic processing by using the second depth data stored in the second memory in the image processing apparatus.
Further, the image processing apparatus of the present invention preferably has a write circuit which alternately receives as input frame data indicating said second image data and frame data indicating said second depth data, writes the frame data indicating said second image data to said first memory, and writes the frame data indicating said second depth data to said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which alternately receives as input line data indicating said second image data and line data indicating said second depth data, writes the line data indicating said second image data to said first memory, and writes the line data indicating said second image data to said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which successively receives as input a plurality of data blocks respectively including said second image data and said second depth data for each pixel, writes said second image data included in the input data block to said first memory every time said plurality of data blocks are input, and writes said second depth data to said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which receives as input third image data obtained by chroma key composition of said second depth data with said second image data, extracts said second image data from said third image data, writes the extracted image data to said first memory, extracts said-second depth data from said third image data, and writes the extracted depth data to said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which directly writes said input second image data and second depth data respectively to said first memory and said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which writes said input said second image data and said second depth data to said first memory, reads said second depth data from said first memory, and writes it to said second memory.
Alternatively, the image processing apparatus of the present invention preferably has a write circuit which writes said input said second image data and said second depth data to said second memory and reads said second image data from said second memory and writes it to said first memory.
The image processing method of the present invention includes the steps of performing three-dimensional graphic processing to generate first depth data corresponding to first image data and first depth data corresponding to said image data; writing said first image data and said first depth data in a first memory for storing image data to be output to a display and a second memory for storing depth data of image data stored in said first memory; generating second image data corresponding to image pickup data and second depth data corresponding to said second image data; and writing said second image data and said second depth data respectively to said first memory and said second memory.